It is entirely possible for a crate to have a build script that is simply
the equivalent to
```rustc
fn main() {
println!("cargo:rustc-link-search=native=/some/path");
}
```
Without actually giving anything to link (for example, because the code
contains `#[link(name="foo")]`. In this case, we aren't actually passing
`-L` through when running doctests, even though they're passed when
compiling the main crate.
Fixes #1592
let any_dylib = output.library_links.iter().any(|l| {
!l.starts_with("static=") && !l.starts_with("framework=")
});
- if !any_dylib { continue }
+ if !any_dylib && !output.library_links.is_empty() {
+ continue
+ }
for dir in output.library_paths.iter() {
cx.compilation.native_dirs.insert(pkg.clone(), dir.clone());
}